package grib2handler.util;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CommonUtil {
	public static String countSpace(int length) {
		String s = " ";
		switch(length) {
			case 3 : s = "      ";
				break;
			case 4 : s = "     ";
				break;
			case 5 : s = "    ";
				break;
			case 6 : s = "   ";
				break;
		}
		return s;
	}
	
	/**
	 * 提取（） 内内容
	 * @param managers
	 * @return
	 */
	public static List<String> getTeacherList(String managers){
        List<String> ls = new ArrayList<String>();
        Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))");
        Matcher matcher = pattern.matcher(managers);
        while(matcher.find())
            ls.add(matcher.group());
        return ls;
    }
}
